package com.dianxin.smartpark.manager.common.impl;

import com.dianxin.smartpark.dao.dataobject.common.SmartParkMessage;
import com.dianxin.smartpark.dao.mapper.common.SmartParkMessageMapper;
import com.dianxin.smartpark.manager.common.ISmartParkMessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 消息管理业务层处理
 * 
 * @author chenjiasong
 * @date 2021-08-16
 */
@Service
public class ISmartParkMessageServiceImpl implements ISmartParkMessageService
{
    @Resource
    private SmartParkMessageMapper smartParkMessageMapper;

    /**
     * 新增消息管理
     *
     * @param busiId 业务主键
     * @param busiType  业务类型
     * @param title  标题
     * @param content   内容
     * @param tenantId  租户id
     * @return 结果
     */
    @Override
    public Boolean insertSmartParkMessage(Long busiId, Integer busiType, String title, String content, String tenantId, String userId)
    {
        // 验证 todo
        SmartParkMessage smartParkMessage = new SmartParkMessage();
        smartParkMessage.beforeInsert();
        smartParkMessage.setBusiId(busiId);
        smartParkMessage.setBusiType(busiType);
        smartParkMessage.setMessageTitle(title);
        smartParkMessage.setMessageContent(content);
        smartParkMessage.setTenantId(tenantId);
        return smartParkMessageMapper.insertSelective(smartParkMessage)==1;
    }
}
